<?php

namespace App\Http\Requests\Api\Admin;

use App\Http\Requests\Api\FormRequest;

class AdminRouteUpdateRequest extends FormRequest
{
    public function rules()
    {
        return [
            'route_id' => ['required', 'numeric'],
            'redirect' => ['nullable', 'string'],
            'icon' => ['nullable', 'string'],
            'hidden' => ['required', 'boolean'],
            'always_show' => ['required', 'boolean'],
            'no_cache' => ['required', 'boolean'],
            'affix' => ['required', 'boolean'],
            'breadcrumb' => ['required', 'boolean'],
        ];
    }

    public function messages()
    {
        return [
            'route_id.numeric' => '更新路由ID格式错误',
            'required' => ':attribute 必须填写',
            'boolean' => ':attribute 的值只能为0或1'
        ];
    }

}
